import Vue from 'vue'
import App from '@/App'
import store from '@/store'
import router from 'mpvue-router-patch'
import passCardBox from "@/components/passCardBox"
import outEnergy from "@/components/outEnergy"
import skipCardBox from "@/components/skipCardBox"
import { fly, flyRequest, flyResponse } from '@/config/flyio' //flyio 请求插件


Vue.prototype.fly = fly;//vue 原型挂载属性
Vue.prototype.store = store;//vue 原型挂载属性
Vue.use(router)//路由
Vue.component('passCardBox', passCardBox)
Vue.component('skipCardBox', skipCardBox)
Vue.component('outEnergy', outEnergy)

Vue.config.productionTip = true
App.store = store
App.mpType = 'app'

flyRequest(); //请求拦截
flyResponse();//响应拦截

// // 签到缓存 隔天自动过期处理
// function checkLocalDate() {
//   let localDayList = wx.getStorageSync('checkDayList'); //同步操作
//   // 有缓存 才有判断
//   if (localDayList) {
//     let day = localDayList.date.split('T')[0].split("-")[2];
//     let currentDay = new Date();
//     currentDay = currentDay.getDate();
//     // 过期 清楚缓存
//     if (currentDay > day) {
//       wx.removeStorageSync('checkDayList');
//     }
//   }

// }


const app = new Vue(App)
app.$mount()

export default {
  // 这个字段走 app.json
  config: {
    pages: [],
    window: {
      backgroundTextStyle: 'light',
      navigationBarBackgroundColor: '#f45e87',
      navigationBarTitleText: '小马猜猜',
      navigationBarTextStyle: '#fff'
    }
  }
}
